<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
<meta name="renderer" content="webkit" />
<title>主页</title>

    <link rel="stylesheet" type="text/css" href="../../../plugins/bootstrap/3.3.7/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../../../plugins/jquery-easyui/1.8.6/themes/gray/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../../plugins/jquery-easyui/1.8.6/themes/icon.css" />
    <!-- font-awesome图标字体 -->
    <link rel="stylesheet"  href="../../../plugins/font-awesome/css/font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" href="../../../plugins//toastr/2.1.4/toastr.min.css" />
    
    <link rel="stylesheet" type="text/css" href="../../../plugins/select2/4.0.13/css/select2.min.css" />
    
    <link rel="stylesheet" type="text/css" href="../../../plugins/codemirror/lib/codemirror.css" />
    <link rel="stylesheet" type="text/css" href="../../../plugins/codemirror/addon/display/fullscreen.css" />
    <link rel="stylesheet" type="text/css" href="../../../plugins/codemirror/theme/dracula.css" />
    <link rel="stylesheet" type="text/css" href="../../../plugins/codemirror/addon/hint/show-hint.css" />
    
    
    <link rel="stylesheet" href="../../../plugins/zTree_v3/css/zTreeStyle/zTreeStyle.css" media="all" />

    <link rel="stylesheet" type="text/css" href="../../../css/zbootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/zeasyui.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/common.css" /> 
    
    <script type="text/javascript" src="../../../plugins/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="../../../plugins/jquery-rstorage/1.3.2/jquery.rStorage.min.js"></script>
    <script type="text/javascript" src="../../../plugins/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../../../plugins/jquery-easyui/1.8.6/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../../plugins/art-template/template-web.js"></script>
    
    
    <script type="text/javascript" src="../../../plugins/json-editor-master/dist/jsoneditor.js"></script>
    <script type="text/javascript" src="../../../plugins/select2/4.0.13/js/select2.min.js"></script>
    <script type="text/javascript" src="../../../plugins/clipboard/2.0.6/clipboard.min.js"></script>
    <script type="text/javascript" src="../../../plugins/toastr/2.1.4/toastr.min.js"></script>
    
    <script type="text/javascript" src="../../../plugins/zTree_v3/js/jquery.ztree.all.js"></script>
    <script type="text/javascript" src="../../../plugins/zTree_v3/js/jquery.ztree.exhide.js"></script>
    <script type="text/javascript" src="../../../plugins/zTree_v3/js/fuzzysearch.js"></script>
    
    <script type="text/javascript" src="../../../plugins/codemirror/lib/codemirror.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/mode/clike/clike.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/mode/xml/xml.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/mode/css/css.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/mode/javascript/javascript.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/mode/htmlmixed/htmlmixed.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/mode/sql/sql.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/addon/hint/xml-hint.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/addon/hint/show-hint.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/addon/hint/sql-hint.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/addon/hint/html-hint.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/addon/hint/css-hint.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/addon/hint/javascript-hint.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/addon/selection/selection-pointer.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/addon/display/autorefresh.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/addon/display/placeholder.js"></script>
    <script type="text/javascript" src="../../../plugins/codemirror/addon/edit/matchbrackets.js"></script>
    
    
    <script type="text/javascript" src="../../../js/zGlobal.js"></script>
    <script type="text/javascript" src="../../../js/zApi.js"></script>
    <script type="text/javascript" src="../../../js/zUtil.js"></script>
    <script type="text/javascript" src="../../../js/zAlert.js"></script>
    <script type="text/javascript" src="../../../js/zDict.js"></script>
    <script type="text/javascript" src="../../../js/zTable.js"></script>
    <script type="text/javascript" src="../../../js/zDialog.js"></script>
    <script type="text/javascript" src="../../../js/zForm.js"></script>
    <script type="text/javascript" src="../../../js/zJson.js"></script>
    <script type="text/javascript" src="cfgGenerateIndex.js"></script>
    
    <![if IE]>

    <![endif]>

</head>
<style>
.ztree-btn-group{
    float: right;
    display: none;
}
.ztree-opr-btn{
    height: 15px;
    width: 15px;
    line-height: 0;
    margin-left: 5px;
    margin-right: 5px;
    padding: 0;
    display: inline;
    font-size: 10px;
}
.ztree li {
    position: relative;
}
.ztree li:hover > a>.ztree-btn-group {
  display: block;
}
.ztree li:hover > a>.ztree-btn-group {
  display: block;
}
</style>
<body onload="noright(document.body);">

    <div id="p-all" class="easyui-layout" data-options="fit:true,border:false," style="border: 0px solid #D8D9E5;"> 
     <div data-options="region:'center',split:false,border:false,minWidth:500" style="overflow: hidden;width:50%;border-right:1px solid rgb(210, 208, 208);"> 
       <div style="height: 36px;padding:5px 3px;position: absolute;z-index: 2;right: 2px;">
        <input id="table-toggle" class="easyui-switchbutton" style="" />
       </div> 
      <table id="table-left"></table> 
     </div> 
     <div data-options="region:'east',split:true,border:false,minWidth:500" style="overflow: hidden;width:50%;border-left:1px solid rgb(210, 208, 208);"> 
      <table id="table-right"></table> 
     </div> 
    </div> 

  <!---分割-------------------------------------------------------------------------------->
  <div id="dlg-add-left" style="display:none;"> 
   <div class="main-content"> 
    <form>
     <div class="row">&nbsp;</div>
     <div class="row padding-right"> 
     <div class="col-sm-12"> 
          <div class="row" style="padding: 3px;"> 
           <fieldset style="border: 1px solid #e5e5e5;padding-bottom: 5px;"> 
              <legend class=" text-info">说明</legend>
              <span style="color: red;">创建项目并解析表结构、上传模板文件后开始配置</span>
           </fieldset>
          </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">所属项目</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="projectId" name="projectId" data-options="required:true" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">所属模块</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="moduleId" name="moduleId" data-options="required:true" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">模板</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="templateId" name="templateId" data-options="required:true" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">标题</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="cfgGenerateTitle" name="cfgGenerateTitle" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6 hidden"> 
      <label class="form-lable">类型</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="cfgGenerateType" name="cfgGenerateType" data-options="panelHeight:70" style="width:100%;" ></select>
      </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">排序</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="orderNum" name="orderNum" data-options="validType : ['number']" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">备注</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="remarks" name="remarks" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">模块属性扩展</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="attrExtendModule" name="attrExtendModule" data-options="multiline:true,height:80" style="width:100%;" />
     </div> 
     </div> 
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">字段属性扩展</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="attrExtendField" name="attrExtendField" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">属性扩展</label> 
      <div class="input-block"> 
        <div style="p" id="attrExtendField_btn">
          <a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgJeditor('LA1')">基础定义</a>
        </div>
      </div> 
     </div> 
     </div> 
     <div class="row">&nbsp;</div>
    </form> 
   </div> 
  </div>


  <div id="dlg-edit-left" style="display:none;"> 
   <div class="main-content"> 
    <form>
     <div class="row">&nbsp;</div>
     <div class="row padding-right"> 
     <div class="col-sm-6"> 
      <label class="form-lable">配置主键ID</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="cfgGenerateId" name="cfgGenerateId" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">所属项目</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="projectId" name="projectId" data-options="required:true" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">所属模块</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="moduleId" name="moduleId" data-options="required:true" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">模板</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="templetaId" name="templateId" data-options="required:true" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">标题</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="cfgGenerateTitle" name="cfgGenerateTitle" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6 hidden"> 
      <label class="form-lable">类型</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="cfgGenerateType" name="cfgGenerateType" data-options="panelHeight:70" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">排序</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="orderNum" name="orderNum" data-options="validType : ['number']" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">备注</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="remarks" name="remarks" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">输出目录</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="cfgGeneratePath" name="cfgGeneratePath" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">模块属性扩展</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="attrExtendModule" name="attrExtendModule" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">字段属性扩展</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="attrExtendField" name="attrExtendField" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">属性扩展</label> 
      <div class="input-block"> 
        <div style="" id="attrExtendField_btn">
          <a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgJeditor('LE1')">基础定义</a>
        </div>
      </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">状态</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="dataStatus" name="dataStatus" data-options="" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">创建操作员</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="createOprid" name="createOprid" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">创建操作员姓名</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="createName" name="createName" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">创建时间</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="createTm" name="createTm" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">更新操作员</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="lastUpdOprid" name="lastUpdOprid" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">更新操作员姓名</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="lastUpdName" name="lastUpdName" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">更新时间</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="lastUpdTm" name="lastUpdTm" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     </div> 
     <div class="row">&nbsp;</div>
    </form> 
   </div> 
  </div>

  <div id="dlg-query-left" style="display:none;">
   <div class="main-content">
    <form>
    <div class="row">&nbsp;</div>
     <div class="row padding-right">
     <div class="col-sm-12"> 
      <label class="form-lable">所属项目</label> 
      <div class="input-block">
        <select class="easyui-combobox" id="projectId" name="projectId" data-options="" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">所属模块</label> 
      <div class="input-block">
        <select class="easyui-combobox" id="moduleId" name="moduleId" data-options="" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">配置主键ID</label> 
      <div class="input-block">
        <input class="easyui-textbox" id="cfgGenerateId" name="cfgGenerateId" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">标题</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="cfgGenerateTitle" name="cfgGenerateTitle" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     </div> 
     <div class="row">&nbsp;</div>
    </form>
   </div>
  </div>
  <!---分割-------------------------------------------------------------------------------->
  <div id="dlg-add-right" style="display:none;">
   <div class="main-content"> 
    <form>
     <div class="row">&nbsp;</div>
     <div class="row padding-right"> 
     <div class="col-sm-6"> 
      <label class="form-lable">配置ID</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="cfgGenerateId" name="cfgGenerateId" data-options="" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">生成类型</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="generateType" name="generateType" data-options="required:true,panelHeight:70" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">功能模块名称</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="moduleKeyName" name="moduleKeyName" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">功能模块编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="moduleKey" name="moduleKey" data-options="required:true,validType : ['letterNum'],prompt:'例如：test'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">功能模块路径</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="outputModulePath" name="outputModulePath" data-options="required:true,validType : ['packagePath'],prompt:'例如：test，user.test...'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">排序</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="orderNum" name="orderNum" data-options="validType : ['number']" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">排除模板</label> 
      <div class="input-block"> 
        <input class="easyui-combogrid" id="excludeTemplateIds" name="excludeTemplateIds" data-options="multiple:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">方法扩展</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="functionKey" name="functionKey" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">模块属性扩展</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="attrExtendModule" name="attrExtendModule" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">字段属性扩展</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="attrExtendField" name="attrExtendField" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">数据库接口扩展</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableInterface" name="tableInterface" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">完整配置信息</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="configContent" name="configContent" data-options="multiline:true,height:80" style="width:100%;" /> 
        <div style="padding: 2px 0;" id="configContent_btn">
          <a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgJeditor('RA1')" style="color: coral;">基础定义</a>
          <a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgConfig('RA1')" style="color: blue;">完整配置</a>
        </div>
      </div> 
     </div> 
     </div> 
     <div class="row">&nbsp;</div>
    </form> 
   </div> 
  </div>
  
  <div id="dlg-edit-right" style="display:none;">
   <div class="main-content"> 
    <form>
     <div class="row">&nbsp;</div>
     <div class="row padding-right"> 
     <div class="col-sm-6"> 
      <label class="form-lable">配置ID</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="cfgGenerateId" name="cfgGenerateId" data-options="" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">配置明细ID</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="cfgGenerateDtlId" name="cfgGenerateDtlId" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">功能模块名称</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="moduleKeyName" name="moduleKeyName" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">功能模块编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="moduleKey" name="moduleKey" data-options="required:true,validType : ['letterNum'],prompt:'例如：test'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">功能模块路径</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="outputModulePath" name="outputModulePath" data-options="required:true,validType : ['packagePath'],prompt:'例如：test，user.test...'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">生成类型</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="generateType" name="generateType" data-options="required:true,panelHeight:70" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">排序</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="orderNum" name="orderNum" data-options="validType : ['number']" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">排除模板</label> 
      <div class="input-block"> 
        <input class="easyui-combogrid" id="excludeTemplateIds" name="excludeTemplateIds" data-options="multiple:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">方法扩展</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="functionKey" name="functionKey" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">模块属性扩展</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="attrExtendModule" name="attrExtendModule" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">字段属性扩展</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="attrExtendField" name="attrExtendField" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">数据库接口扩展</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableInterface" name="tableInterface" data-options="multiline:true,height:80" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">完整配置信息</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="configContent" name="configContent" data-options="multiline:true,height:80" style="width:100%;" /> 
        <div style="padding: 2px 0;" id="configContent_btn">
          <a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgJeditor('RE1')"  style="color: coral;">基础定义</a>
          <a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgConfig('RE1')"  style="color: blue;">完整配置</a>
<!--           <a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgConfigJsonView('RE1')">JSON视图</a> -->
          <a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgConfigReplace('RE1')" style="color: red;">替换关键字</a>
        </div>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">状态</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="dataStatus" name="dataStatus" data-options="" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">创建操作员</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="createOprid" name="createOprid" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">创建操作员姓名</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="createName" name="createName" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">创建时间</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="createTm" name="createTm" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">更新操作员</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="lastUpdOprid" name="lastUpdOprid" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">更新操作员姓名</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="lastUpdName" name="lastUpdName" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">更新时间</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="lastUpdTm" name="lastUpdTm" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     </div> 
     <div class="row">&nbsp;</div>
    </form> 
   </div> 
  </div>
  
  <div id="dlg-query-right" style="display:none;">
   <div class="main-content">
    <form>
     <div class="row">&nbsp;</div>
     <div class="row padding-right">
     <div class="col-sm-12"> 
      <label class="form-lable">配置ID</label> 
      <div class="input-block">
        <select class="easyui-combobox" id="cfgGenerateId" name="cfgGenerateId" data-options="" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">配置明细ID</label> 
      <div class="input-block">
        <input class="easyui-textbox" id="cfgGenerateDtlId" name="cfgGenerateDtlId" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">模块名称</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="moduleKeyName" name="moduleKeyName" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">模块编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="moduleKey" name="moduleKey" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     </div> 
     <div class="row">&nbsp;</div>
    </form>
   </div>
  </div>

  <div id="dlg-jeditor" style="display:none;">
   <div class="main-content">
    <div class="col-sm-12">
       <fieldset style="border: 1px solid #e5e5e5;padding-bottom: 5px;"> 
          <legend class=" text-info">说明</legend>
              <div><span class="text-danger">#、用于自定义参数，固定参数和自定义参数均可在代码模板中使用。
       </span></div>
       <div><span class="text-info">#、输入类型(type)为单选/多选时：选项来源需为数组格式[]，可配置静态数据或URL请求
       <br>&nbsp;&nbsp;静态数据格式：[{"text":"","value":""},...]；
       url数据格式：静态格式 、或 {resData/list/data/result:[静态格式]}、或{resData/list/data/result:{data/list:[静态格式]}}
       </span></div>
       <div><span class="text-info">#、输入类型(type)为布尔时：否=0,是=1
       </span></div>
      </fieldset>
       
       <div id="jsonedit_JSON" class="jsonedit" style="padding: 5px 0;"></div>
    </div>
   </div>
  </div>

 <div id="dlg-config" style="display:none;">
   <div class="template-show" style="position: absolute;z-index: 1;right:10px;padding: 2px;">
          <a href="javascript:void(0)" class="easyui-linkbutton btn btn-info" id="table-config-template-show-btn3">动态参数</a>
   </div>
   <div id="dlg-config-tabs"  data-options="fit:true" >
    <div id="dlg-config-t1" title="基础配置" data-options="fit:true,border:false"> 
      <div class="easyui-layout" data-options="fit:true,border:false">
       <div class="no-tip" data-options="region:'west',split:true,border:false,title:'模块配置',minWidth:350,expandMode:'dock',hideCollapsedContent:false" style="overflow: hidden;width:350px;border-right:1px solid rgb(210, 208, 208);"> 
        <table id="table-config-main"></table>
       </div>
       <div class="no-tip" data-options="region:'center',border:false,title:'方法配置',expandMode:'dock',minWidth:400" style="overflow: hidden;width:auto;border-left:1px solid rgb(210, 208, 208);"> 
        <table id="table-config-method"></table> 
       </div>
      </div>
    </div>
    <div id="dlg-config-t2" title="表配置"  data-options="fit:true,border:false"> 
      <div class="easyui-layout" data-options="fit:true,border:false">
       <div class="no-tip"data-options="region:'west',split:true,border:false,title:'主子表关系配置',expandMode:'dock',minWidth:200,hideCollapsedContent:false,collapsed:true" style="overflow: hidden;width:20%;"> 
          <div id="table-table-rel-toolbar" style="padding:3px;height:auto">
            <div>
              <a href="javascript:void(0);" class="easyui-linkbutton" id="toolbar-bt1">选择</a>
            </div>
            </div>
          <div style="height:100%;"><table id="table-config-tbl-rel"></table></div>
       </div>
       <div class="no-tip"data-options="region:'center',split:true,border:false,title:'表',minWidth:400" style="overflow: hidden;width:50%;"> 
          <div style="height:100%;"><table id="table-config-tbl"></table></div>
       </div>
       <div class="no-tip" data-options="region:'east',split:true,border:false,title:'字段/SQL内容',expandMode:'dock',minWidth:350,hideCollapsedContent:false" style="overflow: hidden;width:30%;"> 
       
       <div id="table-accordion" class="easyui-accordion" data-options="fit:true,multiple:false">
        <div title="表"  data-options="" style="padding:10px;">
           <div id="table-table-data-toolbar" style="padding:3px;height:auto">
            <div>
            <input id="tableAlias" data-options="required:true,prompt:'表别名,例t1,t2...'" class="easyui-textbox" style="width:250px" />
              <a href="javascript:void(0);" class="easyui-linkbutton" id="toolbar-bt1">快捷选择</a>
            </div>
            </div>
            <div style="height:calc(100% - 40px);position: relative;border: 1px solid #D2D2D2;">
                <textarea id="tableData" name="tableData" style="display:none;"></textarea>
            </div>
        </div>
        <div title="字段" data-options="" style="">
          <div id="table-table-entity-toolbar" style="padding:3px;height:auto">
          <div>
            <input id="tableAlias" data-options="required:true,prompt:'表别名,例t1,t2...'" class="easyui-textbox" style="width:250px" />
            <a href="javascript:void(0);" class="easyui-linkbutton" id="toolbar-bt1">添加</a>
            <a href="javascript:void(0);" class="easyui-linkbutton" id="toolbar-bt2">删除数据</a>
          </div>
          </div>
          <table id="table-table-entity" listlevel="entityData" style=""></table>
        </div>
        <div title="条件" data-options="" style="">
          <div id="table-table-where-toolbar" style="padding:3px;height:auto">
          <div>
            <input id="tableAlias" data-options="required:true,prompt:'表别名,例t1,t2...'" class="easyui-textbox"  style="width:250px" />
            <a href="javascript:void(0);" class="easyui-linkbutton" id="toolbar-bt1">添加</a>
            <a href="javascript:void(0);" class="easyui-linkbutton" id="toolbar-bt2">删除数据</a>
          </div>
          </div>
          <table id="table-table-where" listlevel="whereData" style=""></table>
        </div>
       </div>
          
          
       </div>
      </div>
    </div>
    <div id="dlg-config-t3" title="模板配置" data-options="fit:true,border:false">
     <div class="easyui-layout" data-options="fit:true,border:false">
       <div class="no-tip" data-options="region:'center',border:false,title:'模板',minWidth:450" style="overflow: hidden;width:auto;"> 
        <table id="table-config-template"></table>
       </div>
      <div class="no-tip" data-options="region:'east',split:true,border:false,title:'批量修改',expandMode:'dock',minWidth:350,hideCollapsedContent:false" style="overflow: hidden;width:450px;border-left:1px solid rgb(210, 208, 208);"> 
      <div class="easyui-layout" data-options="fit:true,border:false" style="height:100%;text-align: center;"> 
       <div class="template-show" style="position: absolute;z-index: 1;bottom: 5px; width: 100%;">
          <p><span class="text-danger">注意：标注的字段不为空都会更新,置空填写"NAN"</span></p>
          <a href="javascript:void(0)" class="easyui-linkbutton btn btn-info" id="table-config-template-show-btn">清空</a> 
          <a href="javascript:void(0)" class="easyui-linkbutton btn btn-info" id="table-config-template-show-btn2">保存</a> 
          
       </div>
       <div style="height:100%;overflow-x: hidden;padding-right:30px;"> 
       <div id="table-config-template-show" class="col-sm-12" style="width:cacl(100% - 20px);">
        <div class="col-sm-12">
            <div>&nbsp;</div>
        </div>
        <div class="hidden">
          <input class="easyui-textbox" id="templateId" name="templateId" data-options="label:'模板明细主键',labelWidth:'120',readonly:true" style="width:100%;" />
          <input class="easyui-textbox" id="templateFileId" name="templateFileId" data-options="label:'模板',labelWidth:'120',readonly:true" style="width:100%;" />
        </div>
        <div class="col-sm-12">
            <label class="form-lable">文件标题</label>
            <div class="input-block">
              <input class="easyui-textbox" id="fileTitle" name="fileTitle" data-options="readonly:true" style="width:100%;" />
            </div>
        </div>
        <div class="col-sm-12">
            <label class="form-lable">文件名称</label>
            <div class="input-block">
              <input class="easyui-textbox" id="fileName" name="fileName" data-options="readonly:true" style="width:100%;" />
            </div>
        </div>
        <div class="col-sm-12">
            <label class="form-lable">模板引用名</label>
            <div class="input-block">
              <input class="easyui-textbox" id="quoteTag" name="quoteTag" data-options="readonly:true" style="width:100%;" />
            </div>
        </div>
        <div class="col-sm-12">
            <label class="form-lable">输出文件格式</label>
            <div class="input-block">
              <input class="easyui-textbox" id="outputFileFormat" name="outputFileFormat" data-options="readonly:true" style="width:100%;" />
            </div>
        </div>
        <div id="table-config-template-show1">
         <div class="col-sm-12">
           <div style="text-align: left;background: #FFFD77;color: red;word-break: break-all;"><span name="wholePath"></span></div>
         </div>
        <div class="col-sm-12">
            <label class="form-lable"><span class="text-danger">输出基础路径</span></label>
            <div class="input-block">
              <input class="easyui-textbox" id="outputBasePath" name="outputBasePath" data-options="onChange:showWholePath" style="width:100%;" />
            </div>
        </div>
        <div class="col-sm-12">
            <label class="form-lable"><span class="text-danger">输出路径</span></label>
            <div class="input-block">
              <input class="easyui-textbox" id="outputPath" name="outputPath" data-options="onChange:showWholePath" style="width:100%;" />
            </div>
        </div>
        <div class="col-sm-12">
            <label class="form-lable"><span class="text-danger">输出文件名</span></label>
            <div class="input-block">
              <input class="easyui-textbox" id="outputFileName" name="outputFileName" data-options="onChange:showWholePath" style="width:100%;" />
            </div>
        </div>
        <div class="col-sm-12 hidden">
            <label class="form-lable"><span class="text-danger">引入文件路径</span></label>
            <div class="input-block">
              <input class="easyui-textbox" id="importFile" name="importFile" data-options="multiline:true,height:60" style="width:100%;" />
            </div>
        </div>
        <div class="col-sm-12">
            <label class="form-lable"><span class="text-danger">import类路径</span></label>
            <div class="input-block">
              <input class="easyui-textbox" id="importClazz" name="importClazz" data-options="multiline:true,height:60" style="width:100%;" />
            </div>
        </div>
        <div class="col-sm-12">
            <label class="form-lable"><span class="text-danger">resource类名</span></label>
            <div class="input-block">
              <input class="easyui-textbox" id="autowiredClazz" name="autowiredClazz" data-options="multiline:true,height:60" style="width:100%;" />
            </div>
        </div>
        <div class="col-sm-12">
            <label class="form-lable"><span class="text-danger">extends类名</span></label>
            <div class="input-block">
              <input class="easyui-textbox" id="extendClazz" name="extendClazz" data-options="" style="width:100%;" />
            </div>
        </div>
       </div>
       <div class="col-sm-12">
            <div style="height:80px;">&nbsp;</div>
       </div>
       </div>
      </div>
      </div>
      </div>
     </div>
    </div>
    <div id="dlg-config-t4" title="对象配置"  data-options="fit:true,border:false"> 
      <div class="easyui-layout" data-options="fit:true,border:false">
       <div class="no-tip"data-options="region:'west',split:false,border:false,title:'方法',expandMode:'dock',hideCollapsedContent:false" style="overflow: hidden;width:300px;border-right:1px solid rgb(210, 208, 208);"> 
          <div class="overflow-y"><ul id="tree-main-method" style=""></ul></div>
       </div>
       <div class="no-tip" data-options="region:'center',split:false,border:false,title:'方法对象'" style="overflow: hidden;width:auto;border-left:1px solid rgb(210, 208, 208);"> 
          <table id="table-tree-method-entity" style=""></table>
       </div>
      </div>
    </div>
    
   </div>
  </div>

  <div id="dlg-use-path" style="display:none;overflow: hidden;">
      <div class="easyui-tabs" style="height: 100%;overflow: hidden;">
        <div title="模板路径变量" style="height: 100%;overflow: hidden;padding:5px;">
         <div style="height: 100%;overflow: auto;">
         <table id="table1" class="table table-condensed">
          <tbody></tbody>
         </table>
         </div>
        </div>
        <div title="变量使用说明" data-options="headerCls:'btn-info'" style="height: 100%;overflow: hidden;padding:5px;color: red;">
         <div style="height: 100%;overflow: auto;">
         <table id="table4" class="table table-condensed">
          <tbody></tbody>
         </table>
         </div>
        </div>
        <div title="模板变量" style="height: 100%;overflow: hidden;padding:5px;">
         <div style="height: 100%;overflow: auto;">
         <table id="table6" class="table table-condensed">
          <tbody></tbody>
         </table>
         </div>
        </div>
        <div title="JAVA类" data-options="headerCls:'btn-info'" style="height: 100%;overflow: hidden;padding:5px;">
         <div style="height: 100%;overflow: auto;">
         <table id="table5" class="table table-condensed">
          <tbody></tbody>
         </table>
         </div>
        </div>
      </div>
  </div>
  
  <div id="dlg-select-table-rel" style="display:none;overflow: hidden;">
   <div class="main-content">
      <div class="easyui-layout" data-options="fit:true,border:false">
       <div class="no-tip"data-options="region:'west',split:true,border:false,title:'主表(当前选中表)'" style="overflow: hidden;width:50%;border-right:1px solid rgb(210, 208, 208);"> 
          <table id="table-rel-colunms-left"></table>
       </div>
       <div class="no-tip" data-options="region:'center',split:false,border:false,title:'子表'" style="overflow: hidden;width:auto;border-left:1px solid rgb(210, 208, 208);"> 
          <div id="table-rel-toolbar-right" style="padding:5px;height:auto">
          <div>
            <select class="easyui-combobox" id="tableCode" name="tableCode" data-options="required:true" style="width:300px;" ></select>
          </div>
          </div>
          <table id="table-rel-colunms-right"></table>
       </div>
      </div>
   </div>
  </div>
  
  <div id="dlg-select-table-cols" style="display:none;overflow: hidden;">
   <div class="main-content">
      <div  style="height: 100%; overflow: auto;" > 
        <div id="table-colunms-toolbar" style="padding:5px;height:auto">
        <div>
            <span>表编码 </span><input id="tableCode" name="tableCode" class="easyui-textbox" data-options="prompt:'模糊查询'" style="width:200px" />
            <span>标签 </span><input name="tableTag" class="easyui-textbox" data-options="prompt:'模糊查询'" style="width:200px" />
            <a href="javascript:void(0);" class="easyui-linkbutton" id="toolbar-bt1">查询</a>
            <a href="javascript:void(0);" class="easyui-linkbutton" id="toolbar-bt2">清空选中</a>
        </div>
        </div>
        <table id="table-colunms"></table>
       </div> 
   </div>
  </div>
  <div id="dlg-select-table-info" style="display:none;overflow: hidden;">
   <div class="main-content">
      <div  style="height: 100%; overflow: auto;" > 
        <div id="table-info-toolbar" style="padding:5px;height:auto">
        <div>
            <span>表编码 </span><input id="tableCode" name="tableCode" class="easyui-textbox" data-options="prompt:'模糊查询'" style="width:200px" />
            <span>标签 </span><input name="tableTag" class="easyui-textbox" data-options="prompt:'模糊查询'" style="width:200px" />
            <a href="javascript:void(0);" class="easyui-linkbutton" id="toolbar-bt1">查询</a>
            <a href="javascript:void(0);" class="easyui-linkbutton" id="toolbar-bt2">清空选中</a>
        </div>
        </div>
        <table id="table-info"></table>
       </div> 
   </div>
  </div>
  
  <div id="dlg-method-entity-edit" style="display:none;overflow: hidden;">
   <div class="main-content">
     <form style="height: 100%;">
      <div id="entity-attr" class="col-sm-8 overflow-n"> 
      <div style="position: absolute;top: 0;right: 50px;padding: 3px;z-index: 1;"> 
      <span class="text-danger">注意：批量更新选中的不为空字段,置空填写"NAN" </span>
      <a href="javascript:void(0);"  class="btn btn-default btn-xs" id="entity-attr-bt2" >清空选中</a>
      </div>
      <div class="overflow-y" >
      <div class="row">&nbsp;</div>
      <div class="col-sm-12"> 
          <div class="row" style="padding: 3px;"> 
           <fieldset style="border: 1px solid #e5e5e5;padding-bottom: 5px;"> 
              <legend class=" text-info">说明</legend>
              <span style="color: red;">字段用途取决于模板中的写法，作为判断标志或直接输出</span>
           </fieldset>
          </div> 
     </div>
      <div class="col-sm-12"> 
          <div class="row"> 
           <fieldset> 
              <legend class=" text-info">基础属性</legend> 
           </fieldset> 
          </div> 
      </div> 
      <div class="col-sm-6"> 
      <label class="form-lable">字段标题
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_fieldTitle"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="fieldTitle" name="fieldTitle" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">驼峰编码
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_fieldJavaCode"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="fieldJavaCode" name="fieldJavaCode" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">驼峰编码2
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_fieldJavaCode2"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="fieldJavaCode2" name="fieldJavaCode2" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">字段编码
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_fieldCode"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="fieldCode" name="fieldCode" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">使用范围
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_fieldUseType"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-combobox" id="fieldUseType" name="fieldUseType" data-options="required:true,panelHeight:200" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
          <label class="form-lable">字段类型
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_fieldType"/></div>
          </label> 
          <div class="input-block"> 
            <select class="easyui-combobox" id="fieldType" name="fieldType" data-options="required:true,panelHeight:150" style="width:100%;" ></select>
          </div> 
         </div> 
      <div class="col-sm-6"> 
          <label class="form-lable">加载模板
            <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_selectTemplate"/></div>
          </label> 
          <div class="input-block"> 
           <input class="easyui-combobox" id="selectTemplate" name="selectTemplate" data-options="prompt:'一般用于生成嵌套对象/集合',panelHeight:200" style="width:100%;" /> 
          </div> 
      </div>
     <div class="col-sm-12"> 
          <div class="row"> 
           <fieldset> 
              <legend class=" text-info">页面属性</legend> 
           </fieldset> 
          </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">引用模块
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_useModuleCode"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="useModuleCode" name="useModuleCode" data-options="prompt:'复杂页面引用其他模块配置'" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">引用模块方法
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_useMethodCode"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="useMethodCode" name="useMethodCode" data-options="prompt:'复杂页面引用其他模块配置'" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">查询运算符
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_conditionSymbol"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="conditionSymbol" name="conditionSymbol" data-options="panelHeight:200,prompt:'一般用于分页查询条件'" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">组件类型
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_inputType"/></div>
      </label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="inputType" name="inputType" data-options="required:true" style="width:100%;" ></select>
        <input id="componentType" name="componentType" type="hidden" /> 
      </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">组件数量
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_inputNumber"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="inputNumber" name="inputNumber" data-options="" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">组件默认值
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_inputVal"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="inputVal" name="inputVal" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
          <label class="form-lable">栅格宽度
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_gridClonums"/></div>
          </label> 
          <div class="input-block"> 
            <input class="easyui-slider" id="gridClonums" name="gridClonums" data-options="required:true,value:6,min:1,max:24,step:1,rule:['',2,'',4,'',6,'',8,'',10,'',12,'',14,'',16,'',18,'',20,'',22,'',24]" style="width:100%;" />  
          </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">组件字典
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_inputDict"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="inputDict" name="inputDict" data-options="" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">组件样式
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_inputClass"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="inputClass" name="inputClass" data-options="" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-6"> 
          <label class="form-lable">显示标志
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_pageShowFlag"/></div>
          </label> 
          <div class="input-block"> 
            <select class="easyui-combobox" id="pageShowFlag" name="pageShowFlag" data-options="required:true,panelHeight:70" style="width:100%;" ></select>
          </div> 
      </div>
      <div class="col-sm-6"> 
          <label class="form-lable">显示顺序
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_pageOrder"/></div>
          </label> 
          <div class="input-block"> 
            <input class="easyui-textbox" id="pageOrder" name="pageOrder" data-options="" style="width:100%;" /> 
          </div> 
      </div>
      <div class="col-sm-6"> 
          <label class="form-lable">是否只读
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_readonlyFlag"/></div>
          </label> 
          <div class="input-block"> 
            <input class="easyui-combobox" id="readonlyFlag" name="readonlyFlag" data-options="required:true,panelHeight:70" style="width:100%;" /> 
          </div> 
      </div>
      <div class="col-sm-6"> 
          <label class="form-lable">分组编码
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_groupCode"/></div>
          </label> 
          <div class="input-block"> 
            <input class="easyui-textbox" id="groupCode" name="groupCode" data-options="prompt:'便于字段分组展示,N表示无分组'" style="width:100%;" /> 
          </div> 
         </div> 
         <div class="col-sm-6"> 
          <label class="form-lable">分组名称
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_groupName"/></div>
          </label> 
          <div class="input-block"> 
            <input class="easyui-textbox" id="groupName" name="groupName" data-options="prompt:'便于字段分组展示'" style="width:100%;" /> 
          </div> 
         </div>
      
      <div class="col-sm-12"> 
      <label class="form-lable">组件options
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_inputOptions1"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="inputOptions1" name="inputOptions1" data-options="multiline:true,height:60,prompt:'标准JSON'" style="width:100%;" /> 
        <a href="javascript:void(0);"  class="btn btn-default btn-sm" id="inputOptions-bt1" >视图编辑</a>
        <span class="text-warning">标准JSON字符，手动修改后需要进入视图保存</span>
      </div> 
     </div> 
     <div class="col-sm-12 hidden"> 
      <label class="form-lable">组件最终options
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_inputOptions2"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="inputOptions2" name="inputOptions2" data-options="multiline:true,readonly:true,height:60,prompt:'无需直接修改，随配置JSON联动。JS中用的最终JSON'" style="width:100%;" /> 
      </div> 
      </div>
      <div class="col-sm-12 hidden"> 
      <label class="form-lable">组件options定义
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_inputOptions3"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="inputOptions3" name="inputOptions3" data-options="multiline:true,height:60,readonly:true,prompt:'无需直接修改，随配置JSON联动。属性定义JSON'" style="width:100%;" /> 
      </div> 
      </div>
      <div class="col-sm-12"> 
          <div class="row"> 
           <fieldset> 
              <legend class=" text-info">后台属性</legend> 
           </fieldset> 
          </div> 
      </div>
         <div class="col-sm-6"> 
          <label class="form-lable">引用表编码
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_useTableCode"/></div>
          </label> 
          <div class="input-block"> 
            <select class="easyui-textbox" id="useTableCode" name="useTableCode" data-options="prompt:'要使用的表'" style="width:100%;" ></select>
          </div> 
         </div> 
         <div class="col-sm-6"> 
          <label class="form-lable">引用表SQL
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_useTableSqlCode"/></div>
          </label> 
          <div class="input-block"> 
            <select class="easyui-textbox" id="useTableSqlCode" name="useTableSqlCode" data-options="prompt:'要使用的表'" style="width:100%;" ></select>
          </div> 
         </div>
         <div class="col-sm-6"> 
          <label class="form-lable">是否标准类型
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_standardFlag"/></div>
          </label> 
          <div class="input-block"> 
            <select class="easyui-combobox" id="standardFlag" name="standardFlag" data-options="required:true,panelHeight:70" style="width:100%;" ></select>
          </div> 
         </div> 
         <div class="col-sm-6"> 
          <label class="form-lable">JAVA类型
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_javaType"/></div>
          </label> 
          <div class="input-block"> 
            <input class="easyui-textbox" id="javaType" name="javaType" data-options="" style="width:100%;" /> 
          </div> 
         </div> 
         <div class="col-sm-6"> 
          <label class="form-lable">JAVA类型(全)
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_javaFullType"/></div>
          </label> 
          <div class="input-block"> 
            <input class="easyui-textbox" id="javaFullType" name="javaFullType" data-options="" style="width:100%;" /> 
          </div> 
         </div> 
         <div class="col-sm-6"> 
          <label class="form-lable">JAVA扩展类型
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_javaVoType"/></div>
          </label> 
          <div class="input-block"> 
            <input class="easyui-textbox" id="javaVoType" name="javaVoType" data-options="" style="width:100%;" /> 
          </div> 
         </div>
         <div class="col-sm-6"> 
          <label class="form-lable">JDBC类型
          <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_jdbcType"/></div>
          </label> 
          <div class="input-block"> 
            <input class="easyui-textbox" id="jdbcType" name="jdbcType" data-options="" style="width:100%;" /> 
          </div> 
         </div> 
     <div class="col-sm-12"> 
          <div class="row"> 
           <fieldset> 
              <legend class=" text-info">校验属性</legend> 
           </fieldset> 
          </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">是否必填
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_mustFlag"/></div>
      </label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="mustFlag" name="mustFlag" data-options="required:true,panelHeight:70" style="width:100%;" ></select>
      </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">校验类型
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_checkType"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-combobox" id="checkType" name="checkType" data-options="required:true,panelHeight:70" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">校验规则(后台)
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_checkBackground"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="checkBackground" name="checkBackground" data-options="multiline:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">校验规则(页面)
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_checkPage"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="checkPage" name="checkPage" data-options="multiline:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">最大值
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_maxValue"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="maxVal" name="maxVal" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">最小值
      <div style="position: absolute;top: 5px;right: 0;"><input class="easyui-checkbox js-check" id="CK_minValue"/></div>
      </label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="minVal" name="minVal" data-options="" style="width:100%;" /> 
      </div> 
     </div>
     
      
         
         <div class="col-sm-12"> 
          <div class="row"> 
           <fieldset> 
              <legend class=" text-info">扩展属性</legend> 
           </fieldset> 
          </div> 
         </div> 
        <div id="entity-attr-ex" class="pull-left" style="width: 100%;">
            <!--  扩展字段 -->
        </div>
        <div class="col-sm-6"> 
          &nbsp;
         </div> 
      </div>
      </div>
      <div id="entity-attr-other" class="col-sm-4 overflow-n"> 
         <div class="easyui-layout" data-options="fit:true">
            <div data-options="region:'north',split:false" style="height:30px">
              <div style="font-size:13px;line-height: 25px;">批量
                <input class="easyui-radiobutton" id="batchFlag1" name="batchFlag" value="1" />否
                <input class="easyui-radiobutton" id="batchFlag2" name="batchFlag" value="2" />是
                <input class="easyui-radiobutton" id="batchFlag3" name="batchFlag" value="3" />含自身
                 &nbsp; &nbsp; 
                 <a href="javascript:void(0);"  class="btn btn-default btn-xs" id="entity-attr-bt1" > 清空选择</a>
                 <a href="javascript:void(0);"  class="btn btn-default btn-xs" id="entity-attr-bt3" >  同步结构</a>
              </div> 
            </div>
            <div data-options="region:'center'" style="padding:10px;">
                <ul id="tree-entity-attr" style=""></ul>
            </div>
         </div>
      </div>
      
      
    </form>
   </div>
  </div>

  <div id="dlg-method-entity-input-opts" style="display:none;overflow: hidden;">
      <div class="col-sm-12 overflow-y">
        <div id="jsonedit_JSON" class="jsonedit" style="padding: 5px 0;"></div>
      </div>
  </div>
  <div id="dlg-method-entity-json1" style="display:none;overflow: hidden;">
      <div style="height:25px;"><span>用于拷贝当前模块对象到其它模块</span></div>
        <div style="height:calc(100% - 26px);position: relative;border: 1px solid #D2D2D2;">
           <textarea id="fieldJson"></textarea>
        </div>
  </div>
  <div id="dlg-method-entity-json2" style="display:none;overflow: hidden;">
      <div style="height:25px;"><span>用于拷贝其它模块对象到当前模块</span></div>
        <div style="height:calc(100% - 26px);position: relative;border: 1px solid #D2D2D2;">
           <textarea id="fieldJson"></textarea>
        </div>
  </div>

<div id="dlg-method-entity-view-edit" style="display:none;overflow: hidden;">
  <form style="height:100%;">
       <div style="height:100%;display: flex;display: -webkit-flex; flex-direction: row;flex-wrap: wrap;">
       <div style="height:35px;line-height: 30px;white-space: nowrap;">
           <input id="tagKey" name="tagKey" type="hidden" />
           <input class="easyui-radiobutton" id="viewEditType1" name="viewEditType" data-options="onChange:function(checked){configForMethodEntityViewChange(checked);}" value="1" />默认
           <input class="easyui-radiobutton" id="viewEditType2" name="viewEditType" data-options="onChange:function(checked){configForMethodEntityViewChange(checked);}" value="2" />页签定位
           <input class="easyui-radiobutton" id="viewEditType3" name="viewEditType" data-options="onChange:function(checked){configForMethodEntityViewChange(checked);}" value="3" />滚动定位
           <input class="easyui-radiobutton" id="viewEditType4" name="viewEditType" data-options="onChange:function(checked){configForMethodEntityViewChange(checked);}" value="4" />查询表格
           <span class="text-info"> 用内部组件简单的模拟外部组件，组件无交互,只可调基础属性</span>
       </div>
       <div id="view-content" style="height: calc(100% - 35px);width: 70%;max-width:calc(100% - 350px);position: relative;border: 1px solid #D7DADE;padding: 5px;">
           
       </div>
       <div id="view-opr" style="height: calc(100% - 35px);width:30%;min-width:350px; position: relative;border: 1px solid #D7DADE;padding: 5px;">
        
        <div class="col-sm-12"> 
          <div class="row"> 
           <fieldset> 
              <legend class=" text-info">基础属性</legend> 
           </fieldset> 
          </div> 
      </div> 
      <input class="easyui-textbox" id="uniqueId" name="uniqueId" type="hidden" style="width:100%;" /> 
      <div class="col-sm-12"> 
      <label class="form-lable">字段标题</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="fieldTitle" name="fieldTitle" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">驼峰编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="fieldJavaCode" name="fieldJavaCode" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">驼峰编码2</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="fieldJavaCode2" name="fieldJavaCode2" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">字段编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="fieldCode" name="fieldCode" data-options="" style="width:100%;" /> 
      </div> 
     </div>
     
       </div>
       </div>
  </form>
</div>

  <div id="dlg-code-online-look" style="display:none;overflow: hidden;">
   <div class="main-content">
     <div class="easyui-layout" data-options="fit:true,border:false">
       <div class="no-tip"data-options="region:'west',split:true,border:false,title:'代码文件',expandMode:'dock'" style="overflow: hidden;width:400px;border-right:1px solid rgb(210, 208, 208);"> 
          <div class="overflow-y"><ul id="tree-code-file" class="ztree"></ul></div>
       </div>
       <div class="no-tip" data-options="region:'center',split:false,border:false,title:'文件内容'" style="overflow: hidden;width:auto;border-left:1px solid rgb(210, 208, 208);"> 
          <div style="height:100%;position: relative;border: 1px solid #D2D2D2;">
           <textarea id="fileContent" style="display: none;"></textarea>
          </div>
       </div>
      </div>
   </div>
  </div>
  
  <div id="dlg-config-replace" style="display:none;overflow: hidden;">
   <div class="main-content">
     <div class="col-sm-12"> 
      <label class="form-lable">替换模式</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="replaceType" name="replaceType" data-options="required:true,panelHeight:80,data:[{text:'字符',value:'1'},{text:'正则',value:'2'}]" style="width:100%;" ></select>
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">待替换关键字</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="oldstr" name="oldstr" data-options="required:true," style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">替换为</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="newstr" name="newstr" data-options="required:true," style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12" style="color:red;"> 
                注意：替换之后进入配置查看，防止异常；置空填"NAN"
     </div>
   </div>
  </div>
<!--   新增方法定义 -->
  <div id="dlg-add-method" style="display:none;overflow: hidden;">
   <div class="main-content">
     <div class="col-sm-12"> 
      <label class="form-lable">标题</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" name="title" data-options="required:true,prompt:'例如：查询'" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">唯一编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" name="key" data-options="required:true,validType : ['letterNum'],prompt:'例如：query'" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">链接</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" name="url" data-options="required:true,prompt:'例如：/{B_methodKey}'" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">编码1</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" name="code1" data-options="" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">编码2</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" name="code2" data-options="" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">编码3</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" name="code3" data-options="" style="width:100%;" /> 
      </div> 
     </div>
   </div>
  </div>

<!--   新增SQL定义 -->
  <div id="dlg-add-sqlinterface" style="display:none;overflow: hidden;">
   <div class="main-content">
     <div class="col-sm-12"> 
      <label class="form-lable">标题</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" name="title" data-options="required:true,prompt:'例如：查询集合'" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">唯一编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" name="key" data-options="required:true,validType : ['letterNum'],prompt:'例如：selectList'" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">命名编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" name="code" data-options="required:true,validType : ['letterNum'],prompt:'例如：selectList'" style="width:100%;" /> 
      </div> 
     </div>
   </div>
  </div>

 <!--  获取已配置过的模板 -->
  <div id="dlg-select-cfgtemplate" style="display:none;overflow: hidden;">
   <div class="main-content">
       <div  style="height: 100%; overflow: auto;" > 
        <div id="table-cfgtemplate-toolbar" style="padding:5px;height:auto">
        <div>
            <span>模块名称 </span><input id="moduleKeyName" name="moduleKeyName" class="easyui-textbox" data-options="prompt:'模糊查询'" style="width:200px" />
            <span>模块编码</span><input id="moduleKey" name="moduleKey" class="easyui-textbox" data-options="prompt:'模糊查询'" style="width:200px" />
            <a href="javascript:void(0);" class="easyui-linkbutton" onclick="configForTemplateTableCfgtemplateRefresh();">查询</a>
            <div><span style="color: red;">一般选择同一套模板，自动填充引用编码相同的模板配置</span></div>
        </div>
        </div>
        <table id="table-cfgtemplate"></table> 
       </div> 
   </div>
  </div>

   <!--  校验规则选择 -->
  <div id="dlg-select-checkBackground" style="display:none;overflow: hidden;">
       <div  style="height: 100%;" > 
        <div id="table-checkBackground-toolbar" style="padding:5px;height:auto">
            <div><span style="color: red;">选择之后会覆盖现有校验规则字段</span></div>
        </div>
        <table id="table-checkBackground"></table> 
       </div> 
  </div>

<!-- 通用可视化编辑模板 -->
<script id="methodEntityViewTemplate" type="text/template">
</script>


 <script>
  TableToggleFlag = true;//默认开启联动
  TableSelectFlag = null;//默认未选中
  ConfigCloseFlag = true;
  ConfigFirstFlag = true;
  ConfigTabSelectIdx = 0;
  DictNames = {};
  ccJSON ={};
  
  /* --分割------------------------------------------------------------------------------ */
  
  TitleLeft = "代码生成配置";
  IdDlgAddLeft = "#dlg-add-left";
  IdDlgEditLeft = "#dlg-edit-left";
  IdDlgQueryLeft = "#dlg-query-left";
  IdTableLeft = "#table-left";
  TableHeaderLeftMenu = null;
  
  /* --分割------------------------------------------------------------------------------ */
  
  TitleRight = "代码生成配置明细";
  IdDlgAddRight = "#dlg-add-right";
  IdDlgEditRight = "#dlg-edit-right";
  IdDlgQueryRight = "#dlg-query-right";
  IdTableRight = "#table-right";
  TableHeaderRightMenu = null;
  
  /* --分割------------------------------------------------------------------------------ */
  IdDlgRightOpen = null;
  IdDlgJeditor = "#dlg-jeditor";
  JsonJeditor = null;
  JsonReadonly = false;
  IdDlgConfig = "#dlg-config";
  IdTableConfigMain = "#table-config-main";
  IdTableConfigMethod = "#table-config-method";
  
  IdTableConfigTemplate = "#table-config-template";
  IdTableConfigTemplateShow = "#table-config-template-show";
  IdTableConfigTabs = "#dlg-config-tabs";
  IdDlgUsePath = "#dlg-use-path";
  IdTableConfigEdit = null;//编辑对象
  IdTableConfigEditIdx = null;//编辑索引
  ObjParamConfig1 = [];
  ObjParamConfig2 = [];
  ObjParamConfig3 = [];
  SelectTemplateMethod = [];//默认挂载模板
  SelectTemplateTable = [];//默认挂载模板
  
  MethodEntityCopyIdx = null;
  MethodEntityEditIndex = null;
  IdTreeMainMethod = "#tree-main-method";
  IdTableTreeMethodEntity = "#table-tree-method-entity";
  IdDlgSelectTableCols = "#dlg-select-table-cols";
  IdTableColumns = IdDlgSelectTableCols + " #table-colunms";
  IdTableColumnsTb = IdDlgSelectTableCols + " #table-colunms-toolbar";
  IdTableColumnsTbBt1 = IdTableColumnsTb + " #toolbar-bt1";
  IdTableColumnsTbBt2 = IdTableColumnsTb + " #toolbar-bt2";
  IdDlgSelectTableInfo = "#dlg-select-table-info";
  IdTableInfo = IdDlgSelectTableInfo + " #table-info";
  IdTableInfoTb = IdDlgSelectTableInfo + " #table-info-toolbar";
  IdTableInfoTbBt1 = IdTableInfoTb + " #toolbar-bt1";
  IdTableInfoTbBt2 = IdTableInfoTb + " #toolbar-bt2";
  
  IdDlgMethodEntityEdit = "#dlg-method-entity-edit";
  IdMethodEntityAttr = IdDlgMethodEntityEdit + " #entity-attr";
  IdMethodEntityAttrEx = IdDlgMethodEntityEdit + " #entity-attr-ex";
  IdMethodEntityAttrBt1 = IdDlgMethodEntityEdit + " #entity-attr-bt1";
  IdMethodEntityAttrBt2 = IdDlgMethodEntityEdit + " #entity-attr-bt2";
  IdMethodEntityAttrBt3 = IdDlgMethodEntityEdit + " #entity-attr-bt3";
  IdTreeMethodEntityAttr = IdDlgMethodEntityEdit + " #tree-entity-attr";
  IdMethodEntityAttrOther = IdDlgMethodEntityEdit + " #entity-attr-other";
  IdMethodEntityInputOptBt1 = IdDlgMethodEntityEdit + " #inputOptions-bt1";
  
  IdDlgMethodEntityViewEdit = "#dlg-method-entity-view-edit";
  
  
  IdDlgMethodEntityInputOpts = "#dlg-method-entity-input-opts";
  JeditorMethodEntityInputOpts = null;
  IdDlgMethodEntityJson1 = "#dlg-method-entity-json1";
  IdDlgMethodEntityJson2 = "#dlg-method-entity-json2";
  MethodCodeEditor1 = null;
  MethodCodeEditor2 = null;
  
  
  IdTableConfigTbl = "#table-config-tbl";
  IdTableTableEntity = "#table-table-entity";
  IdTableTableWhere= "#table-table-where";
  IdTableTableEntityTb = "#table-table-entity-toolbar";
  IdTableTableWhereTb = "#table-table-where-toolbar";
  IdTableTableDataTb = "#table-table-data-toolbar";
  IdTableTableEntityTbBt1 = IdTableTableEntityTb + " #toolbar-bt1";
  IdTableTableWhereTbBt1 = IdTableTableWhereTb + " #toolbar-bt1";
  IdTableTableDataTbBt1 = IdTableTableDataTb + " #toolbar-bt1";
  IdTableTableEntityTbBt2 = IdTableTableEntityTb + " #toolbar-bt2";
  IdTableTableWhereTbBt2 = IdTableTableWhereTb + " #toolbar-bt2";
  
  TableInfoEditIndex = null;
  TableCodeEditor1 = null;
  
  
  /* --分割------------------------------------------------------------------------------ */
  zUtil.dictLoadSyncOfAutocode("dict.dataStatus,template.outputType,dict.booleanFlag"
        + ",cfg.fieldType,validation.fieldType,cfg.useJavaClass,cfg.generateType,cfg.tableKeyType"
       +",cfg.sqlGenerateType,cfg.tableSqlType,cfg.fieldUseType,cfg.methodOprType,cfg.tableType"
       +",cfg.cfgGenerateType,cfg.conditionSymbol,cfg.conditionSymbolType"
       +",ZSELECT_PROJECT,ZSELECT_PROJECT_MODULE,ZSELECT_TEMPLATE,ZSELECT_TEMPLATE_DTL,ZSELECT_CFG_GENERATE");
  $(function(){
      $('#table-toggle').switchbutton({
      checked:true,
      handleText:'明细',
      width:75,
      height:25,
      handleWidth:35,
      onChange:function(checked){
        if(checked){
          TableToggleFlag = true;
          $('#p-all').layout('expand','east');
        }else{
          TableToggleFlag = false;
          $('#p-all').layout('collapse','east');
        }
        $('#p-all .layout-expand.layout-expand-east').addClass('disabled');
      }
    });
    zUtil.areaSize();
    fieldHoverShow();
    /* --分割------------------------------------------------------------------------------ */
    
    var urlLeft = zGlobal["http"] + "/api/autocode/cfgGenerate/list";
    var buttonsIdxLeft = [0,4];
    var buttonsFuncLeft = [dlgAddLeft,dlgQueryLeft];
    var optionsLeft = {
            queryParams:{},
            url : urlLeft,
            idField: 'cfgGenerateId',
            sortName: 'projectId,orderNum',
            sortOrder: 'desc,desc',
            multiSort: true,
            columns:[[
                {field: 'cfgGenerateId', title: '生成配置主键ID', align: 'center', width: 100, hidden:true},
                {field: 'projectId', title: '所属项目', align: 'center', width: 150, formatter: function(value,rowData,rowIndex){return zUtil.dictConvertOfAutocode(value,"ZSELECT_PROJECT")}},
                {field: 'moduleId', title: '所属模块', align: 'center', width: 150, formatter: function(value,rowData,rowIndex){return zUtil.dictConvertOfAutocode(value,"ZSELECT_PROJECT_MODULE")}},
                {field: 'templateId', title: '模板', align: 'center', width: 150, formatter: function(value,rowData,rowIndex){return zUtil.dictConvertOfAutocode(value,"ZSELECT_TEMPLATE")}},
                //{field: 'cfgGenerateType', title: '类型', align: 'center', width: 80, formatter: function(value,rowData,rowIndex){ return zUtil.dictConvertOfAutocode(value,"cfg.cfgGenerateType")}},
                {field: 'orderNum', title: '排序', align: 'center', width: 80},
                {field: 'dataStatus', title: '状态', align: 'center', width: 80, formatter: function(value,rowData,rowIndex){ return zUtil.dictConvertOfAutocode(value,"dict.dataStatus")}},
                {field: 'createName', title: '创建操作员', align: 'center', width: 100},
                {field: ' ', title: ' ', align: 'center', width: 100},
            ]],
            frozenColumns:[[
//              {field:'', title:'', align:'center', checkbox:true},
             {field:'buttonArr', title:'操作', align:'center', width: 60, formatter:buttonsFormatterLeft},
             {field: 'cfgGenerateTitle', title: '标题', align: 'left',halign: 'center', width: 180},
            ]],
            onDblClickCell: function(rowIndex, field, value){
                if("buttonArr" != field){
                    dlgDtlLeft(rowIndex);
                }
            },
            onSelect: function(rowIndex, rowData){
              if(TableToggleFlag && rowData['cfgGenerateId'] != TableSelectFlag){
                TableSelectFlag = rowData['cfgGenerateId'];
                zUtil.formClear(IdDlgQueryRight + ' form');
                zUtil.val(IdDlgQueryRight + ' #cfgGenerateId',rowData['cfgGenerateId']);
                zUtil.readonly(IdDlgQueryRight + ' #cfgGenerateId');
                zUtil.tableQuery(IdTableRight,{
                  'cfgGenerateId': rowData['cfgGenerateId']
                },{url:urlRight});
              }
            },
            onHeaderContextMenu: function(e, field){
              TableHeaderLeftMenu = zUtil.tableHeaderMenu(e,TableHeaderLeftMenu,IdTableLeft);
            },
            onRowContextMenu: function(e, rowIndex, rowData){
              e.preventDefault();
              zUtil.tableSelected(IdTableLeft,rowIndex);
              if(rowData != null){
                 dlgEditLeft(rowData);
              }
            },
    };
    zUtil.tableInit(IdTableLeft,optionsLeft,buttonsIdxLeft,buttonsFuncLeft);
    
    
    /* --分割------------------------------------------------------------------------------ */
    var urlRight = zGlobal["http"] + "/api/autocode/cfgGenerateDtl/list";
    var buttonsIdxRight = [0,4];
    var buttonsFuncRight = [dlgAddRight,dlgQueryRight];
    var optionsRight = {
            queryParams:{},
            url : '',
            idField: 'cfgGenerateDtlId',
            sortName: 'orderNum',
            sortOrder: 'desc',
            multiSort: true,
            singleSelect: false,
//             checkOnSelect: false,
//             selectOnCheck: false,
            columns:[[
                {field: 'cfgGenerateId', title: '生成配置主键ID', align: 'center', width: 100, hidden: true},
                {field: 'cfgGenerateDtlId', title: '生成配置明细主键ID', align: 'center', width: 100, hidden: true},
                {field: 'moduleKey', title: '模块编码', align: 'left',halign: 'center', width: 100},
                {field: 'outputModulePath', title: '模块路径', align: 'center', width: 100},
                {field: 'generateType', title: '生成类型', align: 'center', width: 80, formatter: function(value,rowData,rowIndex){return zUtil.dictConvertOfAutocode(value,"cfg.generateType")}},
                {field: 'orderNum', title: '排序', align: 'center', width: 60},
                {field: 'dataStatus', title: '状态', align: 'center', width: 60, formatter: function(value,rowData,rowIndex){ return zUtil.dictConvertOfAutocode(value,"dict.dataStatus")}},
                {field: 'createName', title: '创建操作员', align: 'center', width: 100},
                {field: ' ', title: ' ', align: 'center', width: 100},
            ]],
            frozenColumns:[[
             {field:'', title:'', align:'center', checkbox:true},
             {field:'buttonArr', title:'操作', align:'center', width: 85, formatter:buttonsFormatterRight},
             {field: 'moduleKeyName', title: '模块名称', align: 'left',halign: 'center', width: 120},
            ]],
            onDblClickCell: function(rowIndex, field, value){
                if("buttonArr" != field){
                    dlgDtlRight(rowIndex);
                }
            },
            onSelect: function(rowIndex, rowData){
            },
            onHeaderContextMenu: function(e, field){
              TableHeaderRightMenu = zUtil.tableHeaderMenu(e,TableHeaderRightMenu,IdTableRight);
            },
            onRowContextMenu: function(e, rowIndex, rowData){
              e.preventDefault();
              zUtil.tableUnSelected(IdTableRight);
              zUtil.tableSelected(IdTableRight,rowIndex);
              if(rowData != null){
                  dlgEditRight(rowData);
              }
            },
            toolbar:[{
                iconCls: 'fa fa-eye',
                text:'关联生成',
                handler: function(){
                          dlgOnlineLookCode();
                      }
                }
           ]
    };
    zUtil.tableInit(IdTableRight,optionsRight,buttonsIdxRight,buttonsFuncRight);
    
        
        
    /* --分割------------------------------------------------------------------------------ */
    DictNames['ZSELECT_PROJECT'] = 'projectId';
    DictNames['ZSELECT_PROJECT_MODULE'] = 'moduleId';
    DictNames['ZSELECT_TEMPLATE'] = 'templateId';
    DictNames['ZSELECT_CFG_GENERATE'] = 'cfgGenerateId';
    DictNames['dict.dataStatus'] = 'dataStatus';
    DictNames['cfg.generateType'] = 'generateType';
    DictNames['cfg.cfgGenerateType'] = 'cfgGenerateType';
    var linkSelsetIds = [IdDlgQueryLeft,IdDlgAddLeft,IdDlgEditLeft,IdDlgQueryRight,IdDlgAddRight,IdDlgEditRight];
    $.each(linkSelsetIds,function(i,item){
        zUtil.selectFill(item,DictNames,zDictAutocode);
        
        zUtil.inputInit(item +" #projectId",'select',{
            onSelect: function(data){
                if(!data){return;}
                zUtil.selectClear(item +" #moduleId");
                DictNames = {};
                DictNames["ZSELECT_PROJECT_MODULE_"+data["value"]] = "moduleId";
                zUtil.selectFill(item, DictNames, zDictAutocode);
            },
            onChange: function(newValue,oldValue){
                if(newValue){return;}
                zUtil.val(item +" #moduleId", null);
                zUtil.val(item +" #templateId", null);
                DictNames = {};
                DictNames["ZSELECT_PROJECT_MODULE"] = "moduleId";
                DictNames["ZSELECT_TEMPLATE"] = "templateId";
                zUtil.selectFill(item, DictNames, zDictAutocode);
            }
        });
        
        zUtil.inputInit(item +" #moduleId",'select',{
            onSelect: function(data){
                if(!data){return;}
                zUtil.val(item +" #projectId",data['projectId']);
                zUtil.val(item +" #templateId",null);
                zUtil.selectClear(item +" #templateId");
                DictNames = {};
                DictNames["ZSELECT_TEMPLATE_"+data["value"]] = "templateId";
                zUtil.selectFill(item, DictNames, zDictAutocode);
            },
            onChange: function(newValue,oldValue){
                if(newValue){return;}
                zUtil.val(item +" #templateId", null);
                DictNames = {};
                DictNames["ZSELECT_TEMPLATE"] = "templateId";
                zUtil.selectFill(item, DictNames, zDictAutocode);
            }
        });
        
        zUtil.inputInit(item +" #templateId",'select',{
            onSelect: function(data){
                if(!data){return;}
                zUtil.val(item +" #projectId",data['projectId']);
                zUtil.val(item +" #moduleId",data['moduleId']);
            },
        });
    });
    
    $('#table-config-template-show-btn').on('click',function(){
        var data = zUtil.formClear(IdTableConfigTemplateShow);
    });
    $('#table-config-template-show-btn2').on('click',function(){
        IdTableConfigEdit = IdTableConfigTemplate;
        var data = zUtil.valAll(IdTableConfigTemplateShow);
        var ndata = {};
        var outputBasePathVal = data['outputBasePath'];
        var outputFileNameVal = data['outputFileName'];
        var outputPathVal = data['outputPath'];
        var extendClazzVal = data['extendClazz'];
        var importFileVal = data['importFile'];
        var importClazzVal = data['importClazz'];
        var autowiredClazzVal = data['autowiredClazzVal'];
        if(outputBasePathVal != null){
          ndata['outputBasePath'] = (outputBasePathVal==="NAN")?null:outputBasePathVal;
        }
        if(outputFileNameVal != null){
          ndata['outputFileName'] = (outputFileNameVal==="NAN")?null:outputFileNameVal;
        }
        if(outputPathVal != null){
          ndata['outputPath'] = (outputPathVal==="NAN")?null:outputPathVal;
        }
        if(extendClazzVal != null){
          ndata['extendClazz'] = (extendClazzVal==="NAN")?null:extendClazzVal;
        }
        if(importFileVal != null){
          ndata['importFile'] = (importFileVal==="NAN")?null:importFileVal;
        }
        if(importClazzVal != null){
          ndata['importClazz'] = (importClazzVal==="NAN")?null:importClazzVal;
        }
        if(autowiredClazzVal != null){
            ndata['autowiredClazz'] = (autowiredClazzVal==="NAN")?null:autowiredClazzVal;
        }
        tableEditForUpdate(ndata);
    });
    $('#table-config-template-show-btn3').on('click',function(){
        showParamsList();
    });
    
    $(IdTableColumnsTbBt1).on('click',function(){
        tableColumnsQuery();
    });
    $(IdTableColumnsTbBt2).on('click',function(){
        tableColumnsClearSelect();
    });
    $(IdTableInfoTbBt1).on('click',function(){
        tableInfoQuery();
    });
    $(IdTableInfoTbBt2).on('click',function(){
        tableInfoClearSelect();
    });
    
    $(IdMethodEntityAttrBt1).on('click',function(){
        entityAttrEditClear("1");
    });
    $(IdMethodEntityAttrBt2).on('click',function(){
        entityAttrEditClear("2");
    });
    $(IdMethodEntityAttrBt3).on('click',function(){
        entityAttrEditSort();
    });
    $(IdMethodEntityInputOptBt1).on('click',function(){
        dlgEntityInputOpts("1");
    });
    
    $(IdTableTableDataTbBt1).on('click',function(){
        configForTableEntityAdd();
    });
    $(IdTableTableEntityTbBt1).on('click',function(){
        configForTableEntityAdd2('1');
    });
    $(IdTableTableWhereTbBt1).on('click',function(){
        configForTableEntityAdd2('2');
    });
    $(IdTableTableEntityTbBt2).on('click',function(){
        configForTableEntityDelAll('1');
    });
    $(IdTableTableWhereTbBt2).on('click',function(){
        configForTableEntityDelAll('2');
    });
    $('#table-table-rel-toolbar #toolbar-bt1').on('click',function(){
        configForTableRelAdd();
    });
    
    
    $(IdDlgMethodEntityViewEdit).on('click','[cpt-id]',function(e){
        var cptId = $(e.currentTarget).attr("cpt-id");
        if(cptId){
            var snode = zUtil.treegrid(IdTableTreeMethodEntity,"find",cptId);
            zUtil.val(IdDlgMethodEntityViewEdit + ' #fieldTitle',snode['fieldTitle']);
            zUtil.val(IdDlgMethodEntityViewEdit + ' #fieldJavaCode',snode['fieldJavaCode']);
            zUtil.val(IdDlgMethodEntityViewEdit + ' #fieldJavaCode2',snode['fieldJavaCode2']);
            zUtil.val(IdDlgMethodEntityViewEdit + ' #fieldCode',snode['fieldCode']);
            zUtil.val(IdDlgMethodEntityViewEdit + ' #uniqueId',snode['_uniqueId']);
            $(IdDlgMethodEntityViewEdit).find('.cpt-selected').removeClass('cpt-selected');
            $(e.currentTarget).addClass('cpt-selected');
        }
    });
  });
  
  /* --分割------------------------------------------------------------------------------ */
  
  //TODO
  function buttonsFormatterLeft(value,rowData,rowIndex){
    return '<a href="javascript:void(0);" class="easyui-linkbutton" onclick="dlgDelLeft('+rowIndex+');" title="删除" ><i class="fa fa-trash"> </i></a>'
    +' <a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgAddLeft('+rowIndex+');" title="复制" ><i class="fa fa-files-o"> </i></a>';
  }
  //TODO
  function dlgQueryLeft(){
    var dlgSave = function(){
      var params = zUtil.valAll(IdDlgQueryLeft);
      zUtil.tableQuery(IdTableLeft,params);
      zUtil.tableData(IdTableRight,[]);
      zUtil.tableUnSelected(IdTableLeft);
      TableSelectFlag = null;
    };
    var dlgClear = function(){
      zUtil.formClear(IdDlgQueryLeft + ' form');
    };
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgQueryLeft);
    };
    var dlgOptions = {
      title: TitleLeft + '-查询',
    };
    var dlgButtonsIdx = [0,1,2];
    var dlgButtonsFunc =  [dlgSave,dlgClear,dlgClose];
    zUtil.queryInit(IdDlgQueryLeft,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.dialogOpen(IdDlgQueryLeft);
  };
  //TODO
  function dlgQueryxLeft(){
    //zUtil.dialogOpen(IdDlgQueryxLeft);
  };
  //TODO
  function dlgAddLeft(row){
    zUtil.formClear(IdDlgAddLeft + ' form');
    zUtil.readonlyAll(IdDlgAddLeft,false);
    JsonReadonly = false;
    
    if("number" === $.type(row)){
        zUtil.tableSelected(IdTableLeft,row);
        row = zUtil.tableRows(IdTableLeft);
        var params = {};
        params['cfgGenerateId']  = row['cfgGenerateId'];
        var detail = zUtil.ajaxGetSync(zGlobal["http"] + "/api/autocode/cfgGenerate/detail", params);
        if(zCode["GLOBAL_SUCCESS"] != zUtil.getVal(detail,zConst["busCode"])){
          zUtil.msg('获取信息失败');
          return false;
        }
        detail = detail["resData"];
        zUtil.valAll(IdDlgAddLeft,detail);
    }
    
    var dlgSave = function(){
      if(!zUtil.formCheck(IdDlgAddLeft +' form')){
        return false;
      };
      var params = zUtil.valAll(IdDlgAddLeft);
      var reqData = {reqData: params};
      var result = zUtil.ajaxPostSync(zGlobal["http"] + "/api/autocode/cfgGenerate/add", reqData);
      if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
        var params = zUtil.valAll(IdDlgQueryLeft);
        zUtil.tableQuery(IdTableLeft,params);
        zUtil.dialogClose(IdDlgAddLeft);
        JsonObjLeft = {};
      }else{
        zUtil.msg('保存失败'+(result.busMsg?'. '+result.busMsg:''));
        return false;
      }
    };
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgAddLeft);
      JsonObjLeft = {};
    };
    var dlgOptions = {
       title: TitleLeft + '-新增',
    };
    var dlgButtonsIdx = [0,1];
    var dlgButtonsFunc =  [dlgSave,dlgClose];
    zUtil.dialogInit(IdDlgAddLeft,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);   
    zUtil.dialogOpen(IdDlgAddLeft);
  };
  //TODO  
  function dlgEditLeft(row){
    if($.isNumeric(row)){
         zUtil.tableSelected(IdTableLeft,row);
         row = zUtil.tableRows(IdTableLeft);
    }
    
    zUtil.formClear(IdDlgEditLeft + ' form');
    zUtil.readonlyAll(IdDlgEditLeft,false);
    zUtil.readonly(IdDlgEditLeft + ' #cfgGenerateId');
    zUtil.readonly(IdDlgEditLeft + ' #projectId');
    zUtil.readonly(IdDlgEditLeft + ' #moduleId');
    zUtil.readonly(IdDlgEditLeft + ' #cfgGeneratePath');
    zUtil.readonly(IdDlgEditLeft + ' #dataStatus');
    zUtil.readonly(IdDlgEditLeft + ' #createOprid');
    zUtil.readonly(IdDlgEditLeft + ' #createName');
    zUtil.readonly(IdDlgEditLeft + ' #createTm');
    zUtil.readonly(IdDlgEditLeft + ' #lastUpdOprid');
    zUtil.readonly(IdDlgEditLeft + ' #lastUpdName');
    zUtil.readonly(IdDlgEditLeft + ' #lastUpdTm');
    JsonReadonly = false;
    
    var params = {};
    params['cfgGenerateId']  = row['cfgGenerateId'];
    var detail = zUtil.ajaxGetSync(zGlobal["http"] + "/api/autocode/cfgGenerate/detail", params);
    if(zCode["GLOBAL_SUCCESS"] != zUtil.getVal(detail,zConst["busCode"])){
      zUtil.msg('获取信息失败');
      return false;
    }
    detail = detail["resData"];
          
    var dlgSave = function(){
      if(!zUtil.formCheck(IdDlgEditLeft +' form')){
        return false;
      };
      var params = zUtil.valAll(IdDlgEditLeft);
      var reqData = {reqData: params};
      var result = zUtil.ajaxPostSync(zGlobal["http"] + "/api/autocode/cfgGenerate/edit", reqData);
      if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
        var params = zUtil.valAll(IdDlgQueryLeft);
        zUtil.tableQuery(IdTableLeft,params);
        zUtil.dialogClose(IdDlgEditLeft);
      }else{
        zUtil.msg('保存失败'+(result.busMsg?'. '+result.busMsg:''));
        return false;
      }
    };
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgEditLeft);
    };
    var dlgOptions = {
      title: TitleLeft + '-编辑',
    };
    var dlgButtonsIdx = [0,1];
    var dlgButtonsFunc =  [dlgSave,dlgClose];
    zUtil.dialogInit(IdDlgEditLeft,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.valAll(IdDlgEditLeft,detail);
    zUtil.dialogOpen(IdDlgEditLeft);
  };
  //TODO
  function dlgDtlLeft(row){
    if($.isNumeric(row)){
        zUtil.tableSelected(IdTableLeft,row);
        row = zUtil.tableRows(IdTableLeft);
    }
    zUtil.formClear(IdDlgEditLeft + ' form');
    zUtil.readonlyAll(IdDlgEditLeft);
    JsonReadonly = true;
    
    var params = {};
    params['cfgGenerateId']  = row['cfgGenerateId'];
    var detail = zUtil.ajaxGetSync(zGlobal["http"] + "/api/autocode/cfgGenerate/detail", params);
    if(zCode["GLOBAL_SUCCESS"] != zUtil.getVal(detail,zConst["busCode"])){
      zUtil.msg('获取信息失败');
      return false;
    }
    detail = detail["resData"];
          
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgEditLeft);
    };
    var dlgOptions = {
      title: TitleLeft + '-详情',
    };
    var dlgButtonsIdx = [1];
    var dlgButtonsFunc =  [dlgClose];
    zUtil.dialogInit(IdDlgEditLeft,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.valAll(IdDlgEditLeft,detail);
    zUtil.dialogOpen(IdDlgEditLeft);
  };
  //TODO
  function dlgDelLeft(row){
    if($.isNumeric(row)){
        zUtil.tableSelected(IdTableLeft,row);
        row = zUtil.tableRows(IdTableLeft);
    }
    
    var params = {}; 
    params['cfgGenerateId']  = row['cfgGenerateId'];
    var reqData = {reqData: params};
    var okfunc = function(){
    var result = zUtil.ajaxPostSync(zGlobal["http"] + "/api/autocode/cfgGenerate/del", reqData);
      if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
        var params = zUtil.valAll(IdDlgQueryLeft);
        zUtil.tableQuery(IdTableLeft,params);
      }else{
        zUtil.msg('操作失败'+(result.busMsg?'. '+result.busMsg:''));
        return false;
      }
    };
    zUtil.msgConfirm("确认删除已选中记录?",okfunc);
  };
  //TODO 
  function dlgDelLeftCfgGenerate(){
    var row = zUtil.tableRows(IdTableLeft);
    if(!row){
        zUtil.msg('请先选择记录');
        return false;
    }
    var params = {}; 
    params['cfgGenerateId']  = row['cfgGenerateId'];
    var reqData = {reqData: params};
    var okfunc = function(){
    var result = zUtil.ajaxPostSync(zGlobal["http"] + "/api/autocode/cfgGenerate/delCfgGenerateAndDetail", reqData);
      if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
        var params = zUtil.valAll(IdDlgQueryLeft);
        zUtil.tableQuery(IdTableLeft,params);
        zUtil.tableData(IdTableRight,[]);
      }else{
        zUtil.msg('操作失败');
        return false;
      }
    }
    zUtil.msgConfirm("删除代码配置及明细?",okfunc);
  };
  /* --分割------------------------------------------------------------------------------ */
  //TODO
  function getTableLeft(){
      var rowLeft =  zUtil.tableRows(IdTableLeft);
      if(rowLeft == null || rowLeft.length == 0){
          zUtil.msg('未选择左侧数据');
          return null;
      }
      return rowLeft;
  }
  //TODO
  function buttonsFormatterRight(value,rowData,rowIndex){
    return '<a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgDelRight('+rowIndex+');" title="删除" ><i class="fa fa-trash"> </i></a>'
         +' <a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgAddRight('+rowIndex+');" title="复制" ><i class="fa fa-files-o"> </i></a>'
         +' <a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgOnlineLookCode('+rowIndex+');" title="代码生成" ><i class="fa fa-eye"> </i></a>'
         +' <a href="javascript:void(0)" class="easyui-linkbutton" onclick="doGeneratorDowload('+rowIndex+');" title="ZIP下载" ><i class="fa fa-cloud-download"> </i></a>';
  }
  //TODO
  function dlgQueryRight(){
    var rowLeft = getTableLeft();
    if(rowLeft == null){
      return false;
    };
    zUtil.readonly(IdDlgQueryRight + ' #cfgGenerateId');
    
    var dlgSave = function(){
      var params = zUtil.valAll(IdDlgQueryRight);
      zUtil.tableQuery(IdTableRight,params);
    };
    var dlgClear = function(){
      zUtil.formClear(IdDlgQueryRight + ' form');
      zUtil.val(IdDlgQueryRight + ' #cfgGenerateId',rowLeft['cfgGenerateId']);
    };
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgQueryRight);
    };
    var dlgOptions = {
      title: TitleRight + '-查询',
    };
    var dlgButtonsIdx = [0,1,2];
    var dlgButtonsFunc =  [dlgSave,dlgClear,dlgClose];
    zUtil.queryInit(IdDlgQueryRight,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.dialogOpen(IdDlgQueryRight);
  };
  //TODO
  function dlgQueryxRight(){
    //zUtil.dialogOpen(IdDlgQueryxRight);
  };
  //TODO
  function dlgAddRight(row){
    var rowLeft = getTableLeft();
    if(rowLeft == null){
      return false;
    };
    
    zUtil.formClear(IdDlgAddRight + ' form');
    zUtil.readonlyAll(IdDlgAddRight,false);
    zUtil.val(IdDlgAddRight + ' #cfgGenerateId',rowLeft['cfgGenerateId']);
    zUtil.val(IdDlgAddRight + ' #attrExtendModule',rowLeft['attrExtendModule']);
    zUtil.val(IdDlgAddRight + ' #attrExtendField',rowLeft['attrExtendField']);
    zUtil.readonly(IdDlgAddRight + ' #cfgGenerateId');
    JsonReadonly = false;
    loadGridForTemplateDtl(IdDlgAddRight + " #excludeTemplateIds", rowLeft['templateId']);
    ConfigTabSelectIdx = 0;
    
    if("number" === $.type(row)){
        zUtil.tableUnSelected(IdTableRight);
        zUtil.tableSelected(IdTableRight,row);
        row = zUtil.tableRows(IdTableRight);
        row = row[0];
        var params = {};
        params['cfgGenerateDtlId']  = row['cfgGenerateDtlId'];
        var detail = zUtil.ajaxGetSync(zGlobal["http"] + "/api/autocode/cfgGenerateDtl/detail", params);
        if(zCode["GLOBAL_SUCCESS"] != zUtil.getVal(detail,zConst["busCode"])){
          zUtil.msg('获取信息失败');
          return false;
        }
        detail = detail["resData"];
        zUtil.valAll(IdDlgAddRight,detail);
        zUtil.readonly(IdDlgAddRight + ' #cfgGenerateId',false);
    }
    
    var dlgSave = function(){
      if(!zUtil.formCheck(IdDlgAddRight +' form')){
        return false;
      };
      var params = zUtil.valAll(IdDlgAddRight);
      var reqData = {reqData: params};
      
      var result = zUtil.ajaxPostSync(zGlobal["http"] + "/api/autocode/cfgGenerateDtl/add", reqData);
      if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
        var params = zUtil.valAll(IdDlgQueryRight);
        zUtil.tableQuery(IdTableRight,params);
        if(ConfigCloseFlag){
            zUtil.dialogClose(IdDlgAddRight);
        }
      }else{
        zUtil.msg('保存失败'+(result.busMsg?'. '+result.busMsg:''));
        return false;
      }
    };
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgAddRight);
    };
    var dlgOptions = {
       title: TitleRight + '-新增',
       buttons:  [{
           text:'保存不关闭',
           handler: function(){
               ConfigCloseFlag = false;
               dlgSave();
               ConfigCloseFlag = true;
           }
       }]
    };
    var dlgButtonsIdx = [0,1];
    var dlgButtonsFunc =  [dlgSave,dlgClose];
    zUtil.dialogInit(IdDlgAddRight,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);   
    zUtil.dialogOpen(IdDlgAddRight);
  };
  //TODO  
  function dlgEditRight(row){
    var rowLeft = getTableLeft();
    if(rowLeft == null){
      return false;
    };
    
    loadGridForTemplateDtl(IdDlgEditRight + " #excludeTemplateIds", rowLeft['templateId']);
    ConfigTabSelectIdx = 0;
    
    if($.isNumeric(row)){
        zUtil.tableUnSelected(IdTableRight);
        zUtil.tableSelected(IdTableRight,row);
        row = zUtil.tableRows(IdTableRight);
        row = row[0];
    }
    zUtil.formClear(IdDlgEditRight + ' form');
    zUtil.readonlyAll(IdDlgEditRight,false);
    zUtil.readonly(IdDlgEditRight + ' #cfgGenerateId');
    zUtil.readonly(IdDlgEditRight + ' #cfgGenerateDtlId');
    zUtil.readonly(IdDlgEditRight + ' #dataStatus');
    zUtil.readonly(IdDlgEditRight + ' #createOprid');
    zUtil.readonly(IdDlgEditRight + ' #createName');
    zUtil.readonly(IdDlgEditRight + ' #createTm');
    zUtil.readonly(IdDlgEditRight + ' #lastUpdOprid');
    zUtil.readonly(IdDlgEditRight + ' #lastUpdName');
    zUtil.readonly(IdDlgEditRight + ' #lastUpdTm');
    JsonReadonly = false;
    
    var params = {};
    params['cfgGenerateDtlId']  = row['cfgGenerateDtlId'];
    var detail = zUtil.ajaxGetSync(zGlobal["http"] + "/api/autocode/cfgGenerateDtl/detail", params);
    if(zCode["GLOBAL_SUCCESS"] != zUtil.getVal(detail,zConst["busCode"])){
      zUtil.msg('获取信息失败');
      return false;
    }
    detail = detail["resData"];
    
    var dlgSave = function(){
      if(!zUtil.formCheck(IdDlgEditRight +' form')){
        return false;
      };
      var params = zUtil.valAll(IdDlgEditRight);
      var reqData = {reqData: params};
      var result = zUtil.ajaxPostSync(zGlobal["http"] + "/api/autocode/cfgGenerateDtl/edit", reqData);
      if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
        var params = zUtil.valAll(IdDlgQueryRight);
        zUtil.tableQuery(IdTableRight,params);
        if(ConfigCloseFlag){
            zUtil.dialogClose(IdDlgEditRight);
        }
      }else{
        zUtil.msg('保存失败'+(result.busMsg?'. '+result.busMsg:''));
        return false;
      }
    };
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgEditRight);
    };
    var dlgOptions = {
      title: TitleRight + '-编辑',
      buttons:  [{
          text:'保存不关闭',
          handler: function(){
              ConfigCloseFlag = false;
              dlgSave();
              ConfigCloseFlag = true;
          }
      }]
    };
    var dlgButtonsIdx = [0,1];
    var dlgButtonsFunc =  [dlgSave,dlgClose];
    zUtil.dialogInit(IdDlgEditRight,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.valAll(IdDlgEditRight,detail);
    zUtil.dialogOpen(IdDlgEditRight);
  };
  //TODO
  function dlgDtlRight(row){
    var rowLeft = getTableLeft();
    if(rowLeft == null){
      return false;
    };
    if($.isNumeric(row)){
        zUtil.tableUnSelected(IdTableRight);
        zUtil.tableSelected(IdTableRight,row);
        row = zUtil.tableRows(IdTableRight);
        row = row[0];
    }
    zUtil.formClear(IdDlgEditRight + ' form');
    zUtil.readonlyAll(IdDlgEditRight);
    JsonReadonly = true;
    loadGridForTemplateDtl(IdDlgEditRight + " #excludeTemplateIds", rowLeft['templateId']);
    ConfigTabSelectIdx = 0;
    
    var params = {};
    params['cfgGenerateDtlId']  = row['cfgGenerateDtlId'];
    var detail = zUtil.ajaxGetSync(zGlobal["http"] + "/api/autocode/cfgGenerateDtl/detail", params);
    if(zCode["GLOBAL_SUCCESS"] != zUtil.getVal(detail,zConst["busCode"])){
      zUtil.msg('获取信息失败');
      return false;
    }
    detail = detail["resData"];
    
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgEditRight);
    };
    var dlgOptions = {
      title: TitleRight + '-详情',
    };
    var dlgButtonsIdx = [1];
    var dlgButtonsFunc =  [dlgClose];
    zUtil.dialogInit(IdDlgEditRight,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.valAll(IdDlgEditRight,detail);
    zUtil.dialogOpen(IdDlgEditRight);
  };
  //TODO
  function dlgDelRight(row){
    if($.isNumeric(row)){
        zUtil.tableSelected(IdTableRight,row);
        row = zUtil.tableRows(IdTableRight);
        row = row[0];
    }
    
    var params = {}; 
    params['cfgGenerateDtlId']  = row['cfgGenerateDtlId'];
    var reqData = {reqData: params};
    var okfunc = function(){
      var result = zUtil.ajaxPostSync(zGlobal["http"] + "/api/autocode/cfgGenerateDtl/del", reqData);
      if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
        var params = zUtil.valAll(IdDlgQueryRight);
        zUtil.tableQuery(IdTableRight,params);
      }else{
        zUtil.msg('操作失败'+(result.busMsg?'. '+result.busMsg:''));
        return false;
      }
    }
    zUtil.msgConfirm("确认删除已选中记录?",okfunc);
  };
  
  function dlgOnlineLookCode(row){
      if($.isNumeric(row)){
          zUtil.tableUnSelected(IdTableRight);
          zUtil.tableSelected(IdTableRight,row);
          row = zUtil.tableRows(IdTableRight);
          row = row[0];
      }else if('object' === $.type(row)){
        
      }
      
      var params ={};
      var cfgGenerateDtlIds = [];
      if('undefined' !== $.type(row)){
          params['cfgGenerateId'] = row['cfgGenerateId'];
          cfgGenerateDtlIds.push(row['cfgGenerateDtlId']);
      }else{
          var templateDtlRows = zUtil.tableRows(IdTableRight);
          if(templateDtlRows==null || templateDtlRows.length==0){
              zUtil.msg("至少选择一个配置");
              return false;
          }
          
          var hasKeys = {};
          var flag = true;
          $.each(templateDtlRows,function(i,item){
              params['cfgGenerateId'] = item['cfgGenerateId'];
              cfgGenerateDtlIds.push(item['cfgGenerateDtlId']);
              if(hasKeys[item['moduleKey']]){
                  flag = false;
                  return false;
              }
              hasKeys[item['moduleKey']] ="Y";
          });
          if(!flag){
              zUtil.msg("不能选择相同模块编码");
              return;
          }
      }
      params['cfgGenerateDtlIds'] = cfgGenerateDtlIds;
      var reqData = {reqData: params};
      var result = zUtil.ajaxPostSync(zGlobal["http"] + "/api/autocode/generator", reqData);
      
      if(zCode["GLOBAL_SUCCESS"] != zUtil.getVal(result,zConst["busCode"])){
          if(zUtil.getVal(result,resData.sameFlag)=="1"){
              zUtil.msg('生成失败,模块编码相同不能同时生成');
              return false;
          }
          zUtil.msg('生成失败'+(result.busMsg?'. '+result.busMsg:''));
          return false;
      }else{
          result=result.resData;
          
          var okfunc = function(){
              var JSInfoDlgEditor = null;
              
                var dlgClose = function(){
                  zUtil.dialogClose('#dlg-code-online-look');
                };
                var dlgOptions = {
                   title: '代码预览',
                   onOpen:function(){
                       var editorObj = $('#dlg-code-online-look #fileContent').next('.CodeMirror');
                       if(editorObj.length === 0){
                          JSInfoDlgEditor = CodeMirror.fromTextArea($('#dlg-code-online-look #fileContent')[0], {
                               autoRefresh:true,
                               lineNumbers: true,
                               styleActiveLine: true,
                               matchBrackets: true,
                               lineWrapping: true,
                               theme: 'dracula',
                          });
                          JSInfoDlgEditor.setSize('100%','100%');
                          JSInfoDlgEditor.on('keypress', () => {
                              //编译器内容更改事件
                              JSInfoDlgEditor.showHint();
                          });
                       }else{
                          JSInfoDlgEditor = editorObj[0].CodeMirror;
                       }
                       JSInfoDlgEditor.setValue(" ");
                   }
                };
                var dlgButtonsIdx = [1];
                var dlgButtonsFunc =  [dlgClose];
                zUtil.dialogInit('#dlg-code-online-look',dlgOptions,dlgButtonsIdx,dlgButtonsFunc);   
                zUtil.dialogOpen('#dlg-code-online-look');
                
                
               var filelist = result.fileList;
              
              var zNodes = [];
              for(var i=0;i<filelist.length;i++){
                  var node = filelist[i];
                  var newNode = {
                           id: node.id
                          ,pId: node.parentId
                          ,name: node.fileName
                          ,fileInfo: node
                          ,chkDisabled: true
                          ,nocheck: true
                  };
                  if(node.type === "0"){
                      newNode.open = true;
                  }
                  if(node.type !== "2"){
                      newNode.isParent = true;
                  }
                  zNodes.push(newNode);
              }
              var setting = {
                      check: {
                          enable: true
                         ,chkDisabledInherit: false
                      },
                      data: {
                          simpleData: {
                              enable: true
                          },
                          keep: {
                              parent: true
                          },
                      },
                      view: {
                          nameIsHTML: true,
                          addDiyDom: function(treeId, treeNode) {
                              var diyObj = $('<div class="ztree-btn-group"><button class="btn btn-info ztree-opr-btn" onclick="doZtreeExpandNode(\''+treeId+'\',\''+treeNode.tId+'\');">+</button></div>');
                              if(treeNode.level === 1){
                                  $('#'+treeNode.tId+'_a').append(diyObj);
                              }
                          },
                      },
                      callback: {
                           onClick : function(event, treeId, treeNode){
                               var znode = $.extend(true,{},treeNode);
                               var zattr = znode.fileInfo;
                               var tval = zattr['fileContent'];
                               var mode = "htmlmixed";
                               if(zattr['type']!=="2"){
                                   tval = " ";
                               }
                               if(zattr['fileName'].indexOf('.css')!=-1){
                                   mode = "text/css";
                               }
                               else if(zattr['fileName'].indexOf('.js')!=-1){
                                   mode = "text/javascript";
                               }
                               else if(zattr['fileName'].indexOf('.java')!=-1){
                                   mode = "text/x-java";
                               }
                               else if(zattr['fileName'].indexOf('.xml')!=-1){
                                   mode = "text/x-hive";
                               }else if(zattr['fileName'].indexOf('.json')!=-1){
                                   mode = "application/json";
                               }
                               
                               JSInfoDlgEditor.setOption("mode", mode);
                               JSInfoDlgEditor.setValue(tval);
                           }
                      }
             };
             
             //树形结构初始化
             codeFileTree  =  $.fn.zTree.init($("#tree-code-file"), setting, zNodes);
          };
          zUtil.msgConfirm('完成耗时'+result.useTime+',是否预览?',okfunc);
      }
  }
  function doZtreeExpandNode(treeId,tId){
       var zTreeObj = $.fn.zTree.getZTreeObj(treeId);
       zTreeObj.expandNode(zTreeObj.getNodeByTId(tId), null, true);
  }
  
  function doGeneratorDowload(row){
      if($.isNumeric(row)){
          zUtil.tableUnSelected(IdTableRight);
          zUtil.tableSelected(IdTableRight,row);
          row = zUtil.tableRows(IdTableRight);
          row = row[0];
      }
      
      var okfunc = function(){
          var cfgGenerateDtlIds = [];
          var cfgGenerateId =null;
          if('undefined' !== $.type(row)){
              cfgGenerateId = row['cfgGenerateId'];
              cfgGenerateDtlIds.push("cfgGenerateDtlIds="+row['cfgGenerateDtlId']);
          }else{
              var templateDtlRows = zUtil.tableRows(IdTableRight);
              if(templateDtlRows==null || templateDtlRows.length==0){
                  zUtil.msg("至少选择一个配置");
                  return false;
              }
              
              $.each(templateDtlRows,function(i,item){
                  cfgGenerateId = item['cfgGenerateId'];
                  cfgGenerateDtlIds.push("cfgGenerateDtlIds="+item['cfgGenerateDtlId']);
              });
          }
          var token = $.sessionStorage('myToken');
          window.open(zGlobal["http"] + "/api/autocode/generatorDownload?cfgGenerateId=" + cfgGenerateId
                      +"&"+cfgGenerateDtlIds.join("&")+"&myToken="+token);
      };
      zUtil.msgConfirm('下载之前先生成，否则下载上一次已生成的文件',okfunc);
      
  }
  
  /* --分割------------------------------------------------------------------------------ */
  
  </script>
</body>
</html>